﻿<UserControl x:Class="Skynet.MeshAdministration.Views.MainExamCategory.MainExamCategoryView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="700" d:DesignWidth="500" Loaded="UserControl_Loaded" >
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="3"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>            
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        
        <ToolBar Grid.ColumnSpan="3">
            <Button Content="Save" Style="{StaticResource ButtonStyle}" Command="{Binding SyncCommand}" ></Button>
        </ToolBar>
      
        <GridSplitter Background="DarkGray"  Grid.Column="1"  Grid.Row="1"  Height="Auto"  Width="Auto"   HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></GridSplitter>
        <DataGrid  Grid.Column="2" Grid.Row="1" ItemsSource="{Binding Path=Model.ExamCategories}" 
                   AutoGenerateColumns="False" Name="dgExamCategories" RowEditEnding="dgExamCategories_RowEditEnding" CanUserAddRows="True" CanUserDeleteRows="True" InitializingNewItem="dgExamCategories_InitializingNewItem" KeyDown="dgExamCategories_KeyDown" 
                   PreviewKeyDown="dgExamCategories_PreviewKeyDown" Width="800">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Id}" Visibility="Visible" Header="Id"></DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding Title}" Header="Title"></DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding Description}" Header="Description"></DataGridTextColumn>
            </DataGrid.Columns>            
        </DataGrid>            
    </Grid>
</UserControl>
